package com.yummy.cloud.gateway.manage.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yummy.cloud.gateway.manage.dto.ConfigurableMetadata;
import com.yummy.cloud.gateway.manage.service.InfrastructureService;
import com.yummy.convention.http.Response;

@RestController
@RequestMapping("/infrastructure")
public class GatewayInfrastructureController {
	
	@Autowired
	InfrastructureService infrastructureService;

	@GetMapping("/predicate/list")
	public Response<List<ConfigurableMetadata>> getPredicates(){
		return Response.success(infrastructureService.getPredicateMetadatas());
	}
	
	@GetMapping("/filter/list")
	public Response<List<ConfigurableMetadata>> getFilters(){
		return Response.success(infrastructureService.getFilterMetadatas());
	}
}
